﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EasyInvoice.Services
{
    public class InvoiceDetailsService
    {
        EasyInvoice.SqlCEDAL.IInvoiceDetail dal;

        public InvoiceDetailsService(EasyInvoice.SqlCEDAL.IInvoiceDetail dal)
        {
            if (dal == null)
            {
                throw new ArgumentNullException("dal");
            }
            this.dal = dal;
        }

        public long Save(Model.InvoiceDetail invoiceDetail)
        {
            return dal.Save(invoiceDetail);
        }

        public Model.InvoiceDetail Delete(Model.InvoiceDetail invoiceDetail)
        {
            return dal.Delete(invoiceDetail);
        }

        //public Model.InvoiceDetail Get(long id)
        //{
        //    return dal.GetById(id);
        //}

        public IEnumerable<Model.InvoiceDetail> GetAllByInvoiceId(long id)
        {
            return dal.GetAllByInvoiceId(id);
        }
    }
}
